package com.example.mvpdemo.login.model;

import android.util.Log;

import com.example.mvpdemo.base.BaseModel;
import com.example.mvpdemo.login.contract.LoginContract;
import com.example.mvpdemo.login.presenter.LoginPresenter;

/**
 * name 登录数据处理
 * desc
 * author Sy
 * email 564379992@qq.com
 * created 2020/5/6 16:21
 */
public class LoginModel extends BaseModel<LoginPresenter, LoginContract.M> {
    /**
     * 实例化P层
     *
     * @param mPresenter
     */
    public LoginModel(LoginPresenter mPresenter) {
        super(mPresenter);
    }

    @Override
    public LoginContract.M getContract() {
        return new LoginContract.M() {
            @Override
            public void requestLogin(String phone, String pass) throws Exception {
                if(phone.equals("13420925611") && pass.equals("ffffff")){
                    mPresenter.getContract().responseLoginResult(true);
                }else{
                    mPresenter.getContract().responseLoginResult(false);
                }
            }
        };
    }
}
